package com.gitee.wsl.ext.list

fun List<Boolean>.getTrueIndices(): List<Int> {
    val res = ArrayList<Int>(size)
    for (i in indices)
        if (this[i]) res.add(i)
    return res
}

fun<T> List<T>.getByIndexes(indexes:List<Int>):List<T>{
    val values = mutableListOf<T>()
    indexes.forEach {
        values.add(this[it])
    }
    return values
}